
// Stream  文件读存

const fs = require("fs")    // 读取图片
const zlib = require("zlib")    // 压缩格式
const readStream = fs.createReadStream("./bigdata.json", { encoding: "utf8" })
const writeStream = fs.createWriteStream("./bigdata2.json", { encoding: "utf8" })

readStream
    .pipe(zlib.createGzip())   // 文件压缩
    .pipe(writeStream)








